<?php echo $header; ?>
<div id="page">
        <?php echo $column_left; ?>
        <div id="content">
            <div class="success" <?php if(!$success) echo 'style="display: none;"'; ?>><?php echo $success; ?></div>
            <?php echo $content_top; ?>
          <div id="account-order">
              <h2><?php echo $heading_title; ?></h2>
              <table class="list">
                  <thead>
                  <tr>
                      <td colspan="2"><?php echo $text_order_detail; ?></td>
                  </tr>
                  </thead>
                  <tbody>
                  <tr>
                      <td class="half"><?php if ($invoice_no) { ?>
                          <b><?php echo $text_invoice_no; ?></b> <?php echo $invoice_no; ?><br />
                          <?php } ?>
                          <b><?php echo $text_order_id; ?></b> #<?php echo $order_id; ?><br />
                          <b><?php echo $text_date_added; ?></b> <?php echo $date_added; ?><br />
                          <b><?php echo $column_status; ?>:</b> <?php echo $text_status; ?>
                      </td>
                      <td><?php if ($payment_method) { ?>
                          <b><?php echo $text_payment_method; ?></b> <?php echo $payment_method; ?><br />
                          <?php } ?>
                          <?php if ($shipping_method) { ?>
                              <b><?php echo $text_shipping_method; ?></b> <?php echo $shipping_method; ?><br />
                              <b><?php echo $text_shipping_cost; ?></b> <?php echo $totals[1]['text']; ?>
                          <?php } ?></td>
                  </tr>
                  </tbody>
              </table>
              <table class="list">
                  <thead>
                  <tr>
                      <td><?php echo $text_payment_address; ?></td>
                      <?php if ($shipping_address) { ?>
                      <td><?php echo $text_shipping_address; ?></td>
                      <?php } ?>
                  </tr>
                  </thead>
                  <tbody>
                  <tr>
                      <td class="half"><?php echo $payment_address; ?></td>
                      <?php if ($shipping_address) { ?>
                      <td><?php echo $shipping_address; ?></td>
                      <?php } ?>
                  </tr>
                  </tbody>
              </table>
              <table class="list">
                  <thead>
                  <tr>
                      <td><?php echo $column_name; ?></td>
                      <td><?php echo $column_model; ?></td>
                      <td><?php echo $column_quantity; ?></td>
                      <td><?php echo $column_status; ?></td>
                      <td><?php echo $column_price; ?></td>
                      <td><?php echo $column_total; ?></td>
                      <?php if($status_id==1): ?>
                        <td><?php echo $column_update; ?></td>
                      <?php endif; ?>
                      <?php if ($products) { ?>
                        <?php if($status_id==1): ?>
                            <td><?php echo $column_delete; ?></td>
                        <?php endif; ?>
                      <?php } ?>
                  </tr>
                  </thead>
                  <tbody>
                  <?php foreach ($products as $product) { ?>
                  <tr>
                      <td><?php echo $product['name']; ?>
                          <?php foreach ($product['option'] as $option) { ?>
                          <br />
                          &nbsp;<small> - <?php echo $option['name']; ?>: <?php echo $option['value']; ?></small>
                          <?php } ?></td>
                      <td><?php echo $product['model']; ?></td>
                      <td><?php echo $product['quantity']; ?></td>
                      <td><?php echo $product['status']; ?></td>
                      <td><?php echo $product['price']; ?></td>
                      <td><?php echo $product['total']; ?></td>
                      <?php if($status_id==1): ?>
                        <td><?php echo $product['button_update']; ?></td>
                        <td><?php echo $product['button_delete']; ?></td>
                      <?php endif; ?>
                  </tr>
                  <?php } ?>
                  <?php foreach ($vouchers as $voucher) { ?>
                  <tr>
                      <td><?php echo $voucher['description']; ?></td>
                      <td></td>
                      <td>1</td>
                      <td><?php echo $voucher['amount']; ?></td>
                      <td><?php echo $voucher['amount']; ?></td>
                      <?php if ($products) { ?>
                      <td></td>
                      <?php } ?>
                  </tr>
                  <?php } ?>
                  </tbody>
                  <tfoot>
                  <tr>
                      <td colspan="<?php echo $status_id==1 ? 9 : 7; ?>"></td>
                  </tr>
                  <?php foreach ($totals as $num=>$total): ?>
                      <?php if($num==0): ?>
                          <tr>
                              <td colspan="<?php echo $status_id==1 ? 6 : 4; ?>"></td>
                              <td><b><?php echo $total['title']; ?>:</b></td>
                              <td><b><?php echo $total['text']; ?></b></td>
                          </tr>
                      <?php endif; ?>
                  <?php endforeach; ?>
                  </tfoot>
              </table>
              <?php if ($comment) { ?>
              <table class="list">
                  <thead>
                  <tr>
                      <td><?php echo $text_comment; ?></td>
                  </tr>
                  </thead>
                  <tbody>
                  <tr>
                      <td><?php echo $comment; ?></td>
                  </tr>
                  </tbody>
              </table>
              <?php } ?>
              <?php if ($histories) { ?>
              <h2><?php echo $text_history; ?></h2>
              <table class="list">
                  <thead>
                  <tr>
                      <td><?php echo $column_date_added; ?></td>
                      <td><?php echo $column_status; ?></td>
                      <td><?php echo $column_comment; ?></td>
                  </tr>
                  </thead>
                  <tbody>
                  <?php foreach ($histories as $history) { ?>
                  <tr>
                      <td><?php echo $history['date_added']; ?></td>
                      <td><?php echo $history['status']; ?></td>
                      <td><?php echo $history['comment']; ?></td>
                  </tr>
                  <?php } ?>
                  </tbody>
              </table>
              <?php } ?>
              <div class="buttons">
                  <div class="right"><a href="<?php echo $continue; ?>" class="button"><?php echo $button_continue; ?></a></div>
              </div>
          </div>
          <?php echo $content_bottom; ?>
        </div>
    <?php echo $column_right; ?>
    </div>
<?php echo $footer; ?> 